package uk.ac.ebi.bioinvindex.model.impl.xref;

import uk.ac.ebi.bioinvindex.model.impl.HasReferencesImpl;
import uk.ac.ebi.bioinvindex.model.impl.PublicationImpl;

import javax.persistence.*;

/**
 *
 * @author brandizi
 */
@Entity
public class PublicationXrefImpl extends XrefImpl<PublicationImpl>{

	protected PublicationXrefImpl () {
	}

	public PublicationXrefImpl ( String acc ) {
		this.setAcc ( acc );
	}

	@ManyToOne(targetEntity = uk.ac.ebi.bioinvindex.model.impl.PublicationImpl.class)
  @JoinColumn(name = "publication_id", nullable = true)
	public HasReferencesImpl getOwner () {
		return super.getOwner ();
	}

	@OneToOne ( targetEntity = ReferenceSourceImpl.class, cascade=CascadeType.ALL )
	public ReferenceSourceImpl getSource () {
		return super.getSource();
	}

}
